package com.xbongbong.saas.model;

import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.saas.domain.entity.InvoiceRelationshipEntity;

import java.util.List;
import java.util.Map;

/**
 * @author feng.zheng
 * @version v1.0
 * @date 2019/1/22 16:44
 * @since v1.0
 */
public interface InvoiceRelationshipModel extends IModel<InvoiceRelationshipEntity> {

    /**
     * 根据参数获取
     *
     * @param param 参数
     * @author feng.zheng
     * @return java.util.List<com.xbongbong.saas.domain.entity.ext.InvoiceRelationshipEntity>
     * @date 2019/2/26 15:41
     */
    @Override
    List<InvoiceRelationshipEntity> findEntitys(Map<String, Object> param);

    /**
     * 批量插入
     *
     * @param list 集合
     */
    void batchInsert(List<InvoiceRelationshipEntity> list);


    /**
     * 批量更新
     * @param list
     */
    void updateBatchSerialNo(List<InvoiceRelationshipEntity> list);

    /**
     * 批量更新money
     * @param corpid
     * @param list
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    void updateBatchMoney(String corpid, List<InvoiceRelationshipEntity> list);

    /**
     * 数据单条查询
     *
     * @param key    主键ID
     * @param corpid 公司ID
     * @return Integer
     * @author feng.zheng
     * @date 2019/1/23 20:27
     * @since v1.0
     */
    InvoiceRelationshipEntity getByKey(Long key, String corpid);

    /**
     * 根据发票id删除
     *
     * @param invoiceId 发票id
     * @param corpid 公司id
     * @author feng.zheng
     * @return java.lang.Integer
     * @date 2019/2/26 16:18
     */
    Integer deleteByInvoiceId(Long invoiceId, String corpid);

    /**
     * 根据发票id删除
     *
     * @param invoiceIdIn 发票id集合
     * @param corpid 公司id
     * @author feng.zheng
     * @return java.lang.Integer
     * @date 2019/2/26 16:18
     */
    Integer deleteByInvoiceIdIn(List<Long> invoiceIdIn, String corpid);

    List<InvoiceRelationshipEntity> getByParam(Map<String, Object> map);

    List<Map<String,Object>> getSumMoneyOfContract(Map<String,Object> param);

    List<Map<String,Object>> getSumMoneyofPayment(Map<String,Object> param);

    List<Map<String,Object>> getSumMoneyofPaymentSheet(Map<String,Object> param);

    Integer getCountPaymentOrContract(Map<String, Object> param);

    Integer getCountPayment(Map<String, Object> param);

    Integer getCountPaymentSheet(Map<String, Object> param);

    /**
     * 跟新作废状态
     *
     * @param isCancel 作废
     * @param param 参数
     */
    void updateIsCancel(Integer isCancel, Map<String,Object> param);
}
